
package edu.chl.vrangogym.web.admin;

import edu.chl.vrangogym.persistence.entities.Booking;
import edu.chl.vrangogym.persistence.impl.BookingFacade;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.faces.bean.ManagedBean;

/**
 * 
 * @author Anders
 */
@ManagedBean(name = "AdminBookings")
@RequestScoped
public class AdminBookingsBackingBean implements Serializable {
    @EJB
    private BookingFacade bookingFacade;
    
    private List<Booking> bookings;

    public AdminBookingsBackingBean() {
    }
    
    @PostConstruct
    public void init() {
        updateBookings();
    }
    
    public void updateBookings() {
        bookings = (List<Booking>) bookingFacade.findAll();
    }

    public List<Booking> getBookings() {
        return bookings;
    }

    public void setBookings(List<Booking> bookings) {
        this.bookings = bookings;
    }
    
}
